package com.cn.controller;

import com.cn.common.BaseResult;
import com.cn.entity.dto.LocationDTO;
import com.cn.service.MapService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 地图接口
 * @date 2021-12-4
 * @author yuhao
 */
@RestController
@RequestMapping("/api/map")
public class MapController {
    private final MapService mapService;

    MapController(MapService mapService){
        this.mapService = mapService;
    }

    @PostMapping("/addMapLocation")
    public BaseResult addMapLocation(@RequestBody LocationDTO locationDTO){
        locationDTO = mapService.addMapLocation(locationDTO);
        return BaseResult.ok(locationDTO);
    }
}
